<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

function api_success($data=array()) {
    die(json_encode($data));
}

function api_failed($mesg='') {
    die(json_encode(array('error'=>$mesg)));
}

function resc($str) {
    if (get_magic_quotes_gpc()) {
        $str = stripslashes($str);
    }
    return mysql_real_escape_string($str);
}
